package team.seekers.hula.course.resource.sectionTalk.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import team.seekers.hula.common.annotation.ApiResponseBody;
import team.seekers.hula.common.entity.PageResult;
import team.seekers.hula.course.resource.sectionContentComment.entity.dto.SectionContentCommentQueryManageDTO;
import team.seekers.hula.course.resource.sectionContentComment.entity.dto.SectionContentCommentUpdateDTO;
import team.seekers.hula.course.resource.sectionContentComment.entity.vo.SectionContentCommentManageListVO;
import team.seekers.hula.course.resource.sectionTalk.entity.dto.SectionTalkAddDTO;
import team.seekers.hula.course.resource.sectionTalk.entity.dto.SectionTalkQueryDTO;
import team.seekers.hula.course.resource.sectionTalk.entity.dto.SectionTalkUpdateDTO;
import team.seekers.hula.course.resource.sectionTalk.entity.vo.SectionTalkListManageVO;
import team.seekers.hula.course.resource.sectionTalk.entity.vo.SectionTalkListVO;
import team.seekers.hula.course.resource.sectionTalk.service.SectionTalkManageService;
import team.seekers.hula.course.resource.sectionTalk.service.SectionTalkService;

/**
 * <p>
 * 回答的评论 前端控制器
 * </p>
 *
 * @author hbc
 * @since 2021-02-18
 */
@Controller
@ApiResponseBody
@RequestMapping("/manage/section/talk")
public class SectionTalkManageController {

    @Autowired
    private SectionTalkManageService sectionTalkManageService;

    //分页查询
    @GetMapping("/page")
    public PageResult<SectionTalkListManageVO> pageOrderByGood(SectionTalkQueryDTO queryDTO){
        return sectionTalkManageService.page(queryDTO);
    }

    @PostMapping("/update")
    public void changeVisibility(@RequestBody SectionTalkUpdateDTO updateDTO){
        sectionTalkManageService.updata(updateDTO.getId(),updateDTO.getVisibility());
    }


}

